<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<style type="text/css">
			.pic {
				width: 500px;
				height: 250px;
				margin: 10px auto;
			}
		</style>

	</head>

	<body>
		
		<div class="pic">

			<input type="button" name="bt" id="bt" value="下一张" />
			<img src="img/1.jpg" />

		</div>
		<script type="text/javascript">
			var img = document.getElementById("img");
			var bt = document.getElementById("bt");
			var index = 1;
			bt.onclick = function() {
				if (index < 7) index++;
				img.src = "img/" + index + ".jpg";
			}
		</script>
	</body>

</html>